<?php

/**
 * Extends <code>Iterator</code> with the <code>skip</code>, <code>getSize</code>
 * and <code>getPos</code> methods.
 *
 * @package phpcr
 */
interface phpCr_RangeIterator extends Iterator
{
    /**
     * Skip a number of elements in the iterator.
     *
     * @param skipNum the non-negative number of elements to skip
     */
    public function skip( $skipNum );

    /**
     * Returns the number of elements in the iterator.
     * If this information is unavailable, returns -1.
     *
     * @return a long
     */
    public function getSize();

    /**
     * Returns the current position within the iterator. The number
     * returned is the 0-based index of the next element in the iterator,
     * i.e. the one that will be returned on the subsequent <code>next</code> call.
     * <p/>
     * Note that this method does not check if there is a next element,
     * i.e. an empty iterator will always return 0.
     *
     * @return a long
     */
    public function getPos();
}
